package com.cn.mmd.service;

import com.cn.mmd.mapper.*;
import com.cn.mmd.model.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2016/10/21.
 */
@Service("leadership")
public class LeadershipServiceImpl implements LeadershipService {

    @Autowired
    AvgSchoolMapper avgSchoolMapper;
    @Autowired
    AvgCollegeMapper avgCollegeMapper;
    @Autowired
    StudentEvaluateMapper studentEvaluateMapper;
    @Autowired
    ColleagueEvaluateMapper colleagueEvaluateMapper;
    @Autowired
    SupervisorEvaluateMapper supervisorEvaluateMapper;
    @Autowired
    StudentEvaluateStatisticsMapper studentEvaluateStatisticsMapper;
    @Autowired
    QuestionnaireMapper questionnaireMapper;

    /**
     * 查看全校统计详情
     * @param
     * @return
     */
    public AvgSchool selectAvgSchool(){
        return avgSchoolMapper.selectAvgSchool();
    }


    /**
     * 查看学生统计详情
     * @param studentEvaluate
     * @return
     */
    public List<StudentEvaluate> selectAllStudentEvaluate(StudentEvaluate studentEvaluate){
        return studentEvaluateMapper.selectAllEvaluate(studentEvaluate);
    }


    /**
     * 查看同事统计详情
     * @param colleagueEvaluate
     * @return
     */
    public List<ColleagueEvaluate> selectAllColleagueEvaluate(ColleagueEvaluate colleagueEvaluate){
        return colleagueEvaluateMapper.selectAllEvaluate(colleagueEvaluate);
    }


    /**
     * 查看督导统计详情
     * @param supervisorEvaluate
     * @return
     */
    public List<SupervisorEvaluate> selectAllSupervisorEvaluate(SupervisorEvaluate supervisorEvaluate){
        return supervisorEvaluateMapper.selectAllEvaluate(supervisorEvaluate);
    }


    /**
     * 查看学院统计详情
     * @param collegeName
     * @return
     */
    public AvgCollege selectAvgCollege(String collegeName){
        return avgCollegeMapper.selectByPrimaryKey(collegeName);
    }


    /**
     * 查出指定周的学生评价专业
     * @return
     */
    public List<StudentEvaluate> selectStudentEvaluateByTime(int weekNum){
        return studentEvaluateMapper.selectStudentEvaluateByTime(weekNum);
    }

    /**
     * 添加学生评价周统计
     * @param studentEvaluateStatistics
     * @return
     */
    public int insertStudentEvaluateStatistics(StudentEvaluateStatistics studentEvaluateStatistics){
        return studentEvaluateStatisticsMapper.insertSelective(studentEvaluateStatistics);
    }


    /**
     * 查询学生教评完成率
     * @param studentEvaluateStatistics
     * @return
     */
    public List<StudentEvaluateStatistics> selectStudentEvaluateStatistics(StudentEvaluateStatistics studentEvaluateStatistics){
        return studentEvaluateStatisticsMapper.selectStudentEvaluateStatistics(studentEvaluateStatistics);
    }


    /**
     * 查询数据库中有多少中类型问卷
     * @return
     */
    public List<String> selectQuestionnaireExplain(){
        return questionnaireMapper.selectQuestionnaireExplain();
    }
}
